package com.iRomantic.common;

import com.jfinal.core.Controller;

public abstract class BaseController extends Controller {
	
	public static final String JSP_BASE_PATH = "/WEB-INF/web/";
	
	public static final String OP = "op";
	
	public static final String IOS_FILE = ".file";
	
	public void renderWebJsp(String view){
		super.renderJsp(JSP_BASE_PATH+view);
	} 
	
	public AppJsonResponse createAppJsonResponse(){
		return new AppJsonResponse(this.getPara(OP));
	}
	
	public String iosPictureHandler(String fileName){
		if(fileName.endsWith(".file")){
			fileName = fileName.substring(0, fileName.length()-4) + "jpg";
		}
		return fileName;
	}

}
